<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 21.26 -->

    <script>
        let arr = [2, 4, 6, 8]
        /* let res = arr.reduce((pre, nowValue) => {
            return pre + nowValue;
            // pre: 2 --> 6 --> 12 --> 20
            // nowValue: 4 --> 6 --> 8
        }) */


        let res = arr.reduce((pre, nowValue) => {
            return pre + nowValue;
            // pre: 100 --> 102 --> 106 --> 112 --> 120
            // nowValue: 2 --> 4 --> 6 --> 8
        }, 100)
        console.log(res)
    </script>
</body>

</html>